<?php
/*
 * VCALENDAR
 * VEVENT
 * VTODO
 * VJOURNAL
 * VFREEBUSY
 */

DEFINE( DATE_ICAL, 'Ymd\THis\Z' );
DEFINE( CRLF, "\r\n" );

header( "Content-Disposition: attachment; schedule.ics" );
header( "Content-Type: text/calendar; charset=utf-8" );
//header( "Content-Type: text/plain; charset=utf-8" );

echo "BEGIN:VCALENDAR", CRLF;
echo "VERSION:2.0", CRLF;
echo "PRODID:-//deusex//modcalendar//EN", CRLF;
echo "BEGIN:VEVENT", CRLF;
echo "DTSTART:", gmdate( DATE_ICAL ), CRLF;
echo "DTEND:", gmdate( DATE_ICAL, time() + 86400 ), CRLF;
echo "SUMMARY:", $_SERVER[ 'REMOTE_ADDR' ], " gets married!", CRLF;
echo "END:VEVENT", CRLF;
echo "END:VCALENDAR", CRLF;
